<?php

declare(strict_types=1);

namespace app\controller\manage;

use app\BaseController;
use app\service\member\MemberService;

/**
 * 用户
 */
class Member extends BaseController
{
    protected $memberService;

    public function initialize()
    {
        $this->memberService = make(MemberService::class);
    }
    /**
     * 会员列表
     */
    public function memberList()
    {
        return $this->success($this->memberService->memberList($this->paging()));
    }
    /**
     * 会员信息编辑
     */
    public function memberEdit()
    {
        $data = $this->request->post();
        $res = $this->memberService->memberEdit($data);
        return  $res ? $this->success() : $this->error('修改失败');
    }
}
